export function formatDate(date) {
    // 格式化日期  
    const year = date.getFullYear();
    const month = (date.getMonth() + 1).toString().padStart(2, '0'); // 月份从0开始，所以要+1  
    const day = date.getDate().toString().padStart(2, '0');
    let formattedDate = `${year}-${month}-${day}`;
    return formattedDate;
}
export function formatWeek(date) {
    // 获取星期几  
    const weekdays = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
    let weekday = weekdays[date.getDay()];
    return weekday;
}

export function formatTime(dateTime) {
    let time = dateTime.match(/(\d{2}:\d{2})/)[0];
    return time;
}
